package service

import (
	"context"

	"gitee.com/thewalkers/refactoring-code/model"
)

// AddCommissionedEmployeeTransactionService acts as a struct for injecting an implementation of EmployeeRepository
// for use in service methods
type AddCommissionedEmployeeTransactionService struct {
	AddCommissionedEmployeeTransactionRepository model.AddCommissionedEmployeeTransactionRepository
}

// ACConfig will hold repository that will eventually be injected into this
// service layer
type ACConfig struct {
	AddCommissionedEmployeeTransactionRepository model.AddCommissionedEmployeeTransactionRepository
}

// NewAddCommissionedEmployeeTransactionService is a factory function for
// initializing a EmployeeService with its repository layer dependencies
func NewAddCommissionedEmployeeTransactionService(a *ACConfig) model.AddCommissionedEmployeeTransactionService {
	return &AddCommissionedEmployeeTransactionService{
		AddCommissionedEmployeeTransactionRepository: a.AddCommissionedEmployeeTransactionRepository,
	}
}

func (a *AddCommissionedEmployeeTransactionService) Create(ctx context.Context, e *model.Employee, c *model.CommissionedClassification) error {
	return a.AddCommissionedEmployeeTransactionRepository.Create(ctx, e, c)
}
